package com.wx.mapper;

import cn.hutool.core.date.DateTime;
import com.wx.common.MyMapper;
import com.wx.domain.dto.DayReportQueryParam;
import com.wx.domain.dto.SysPatientFollowDto;
import com.wx.domain.vo.*;
import com.wx.entity.SysPatientFollow;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * <p>Title:	  weixin-go-with-you <br/> </p>
 * <p>Description TODO <br/> </p>
 * <p>Company:    医百科技有限公司  <br/> </p>
 *
 * @Author <a href="yangwensheng@100doc.com.cn"/>杨文生</a>  <br/>
 * @Date 2021/3/27 21:37
 */
@Mapper
@Component
public interface SysPatientFollowMapper extends MyMapper<SysPatientFollow> {

    List<PatientFollowVo> listPage(@Param("patientIds") List<String> patientIds, @Param("param") SysPatientFollow param);

    List<PatientFollowVo> currentMonthListPage(@Param("patientIds") List<String> patientIds,@Param("beginOfMonth") DateTime beginOfMonth,@Param("endOfMonth") DateTime endOfMonth);

    List<PatientFollowVo> listPageByPatientId(@Param("param") SysPatientFollow sysPatientFollow);

    List<EveryDayFollowNumber> queryEveryDayFollowNumber(@Param("patientIds") List<String> patientIds,@Param("startDate") Date startDate,@Param("endDate") Date endDate);

    List<PatientFollowVo> listAllPage(@Param("param") SysPatientFollowDto param);

    int batchInsert(List<SysPatientFollow> list);

    String queryNextFollowTimeByPatientId(String patientId);

    Long queryCurrentDayFollowCount(@Param("patientIds") List<String> patientIds);

    List<PatientFollowVo> listByPatientId(String patientId);

    SysPatientFollow queryLastFollow(String patientId);

    List<SysPatientFollow> selectRemind();

    List<PatientFollowDetailVo> listAllDetail(@Param("param") SysPatientFollowDto sysPatientFollow);

    List<PatientInquiryDetailVo> listInquiryDetail(@Param("param") SysPatientFollowDto sysPatientFollow);

    int deleteInvalidFollows(String patientId);

    List<SysPatientFollow> getLastTwoFollow(@Param("patientId") String patientId);

    List<FollowStatistics> queryTotalFollowCount(DayReportQueryParam dayReportQueryParam);

    List<FollowStatistics> queryTotalInquiryCount(DayReportQueryParam dayReportQueryParam);

    SysPatientFollow queryFirstFollow(@Param("patientId") String patientId);

    int count(@Param("param") SysPatientFollowDto sysPatientFollow);

    List<PatientFollowDetailVo> queryAllByPage(@Param("offset") int offset, @Param("rows")  int rows, @Param("param") SysPatientFollowDto sysPatientFollowDto);

    List<SysPatientFollow> queryByPatientId(@Param("patientId") String patientId, @Param("type") Integer type);

    void deletePatientFollowByPatientId(@Param("patientId") String patientId);
}
